﻿using System;

namespace PropertyStudy
{
    class Test1 {
        public String name="***";
        public int age=1;
        public int a;

        //声明属性(name)
        public String Name
        {
            //如果没什么特殊逻辑要求可以直接像Age属性那样简写
            get {
                return this.name;
            }
            set {
                this.name = value;
            }
        }

        //声明属性(age)
        public int Age {
            get;
            set;
        }


    }

    class Program
    {
        static void Main1(string[] args)
        {
            //Console.WriteLine("Hello World!");
            Test1 test1 = new Test1() { Name="li",Age=100,a=999};
            System.Console.WriteLine(test1.Age);
            test1.age = 10;
            System.Console.WriteLine(test1.Age);
            System.Console.WriteLine("======================");

            System.Console.WriteLine(test1.Name);
            test1.Name = "张三";
            System.Console.WriteLine(test1.Name);

        }
    }
}
